package com.server.questionbank.snframe.service.NoteService.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.server.questionbank.snframe.domain.Note.TNoteFile;
import com.server.questionbank.snframe.mapper.Note.TNoteFileMapper;
import com.server.questionbank.snframe.service.NoteService.TNoteFileService;

@Service
public class TNoteFileServiceImpl extends ServiceImpl<TNoteFileMapper, TNoteFile> implements TNoteFileService {
    
    @Override
    public List<TNoteFile> listByUserId(Long userId) {
        return this.lambdaQuery()
            .eq(TNoteFile::getUserId, userId)
            .orderByDesc(TNoteFile::getUploadTime)
            .list();
    }
    
    @Override
    public TNoteFile getByFilePathAndUserId(String filePath, Long userId) {
        return this.lambdaQuery()
            .eq(TNoteFile::getFilePath, filePath)
            .eq(TNoteFile::getUserId, userId)
            .one();
    }
} 